import java.util.Scanner;

class AAA{
	
}

public class abkcd {

	static public void main(String[] arguments) {
		System.out.printf("Fdsfafsdf:\n");
		int h,m,s,t;
		Scanner scan = new Scanner (System.in);
		h = scan.nextInt();
		m = scan.nextInt();
		s = scan.nextInt();
		t = 3600 * h + m * 60 + s;
		System.out.println (t);
	}
}
